Type.registerNamespace("Telerik.Web.UI.Animations");
Telerik.Web.UI.Animations.playJQueryAnimation=function(m,j,h,f,d,n,c,g){if(!m){return;
}if(!j){j=2;
}if(!h){h=new Sys.UI.Bounds(1,1,1,1);
}if(!f){f=new Sys.UI.Bounds(1,1,1,1);
}var a=g?g:500;
if(!d){d=32;
}d+="";
var k=parseInt(d.substr(0,1));
var e=parseInt(d.substr(1,1));
if(n){n();
}$telerik.$(m).stop(false,true);
if(j==2){$telerik.$(m).css({left:f.x,top:f.y}).fadeIn(a,c);
return;
}if(j==8){var b=$telerik.getClientBounds();
var l=$telerik.getClientBounds();
h.x=l.width/2;
h.y=l.height;
switch(e){case 2:h.x=f.x;
break;
case 3:h.x=b.width;
break;
case 1:h.x=b.x;
}switch(k){case 2:h.y=f.y;
break;
case 1:h.y=b.y-f.height;
break;
case 3:h.y=b.height;
}}else{if(j==4){h.x=f.x;
h.y=f.y;
h.width=f.width;
h.height=1;
switch(e){case 2:h.x=f.x;
break;
case 3:h.x=f.x;
break;
case 1:var i=f.x;
if(2==k){i+=f.width;
}h.x=i;
}switch(k){case 2:h.y=f.y;
h.height=f.height;
h.width=1;
break;
case 1:h.y=f.y+f.height;
break;
case 3:h.y=f.y;
}}else{if(j==1){}}}$telerik.$(m).css({width:h.width,height:h.height,left:h.x,top:h.y,opacity:0.1,filter:"alpha(opacity=10)"}).show().animate({width:f.width,height:f.height,left:f.x,top:f.y,opacity:1},a,null,c);
};
$telerik.$.fx.prototype.oldstep=$telerik.$.fx.prototype.step;
$telerik.$.fx.prototype.step=function(b){if(this.prop=="left"||this.prop=="top"){if(this.elem.getAttribute("paused")){if(!this.elem.getAttribute("elapsedTime")){var a=(+new Date)-this.startTime;
this.elem.setAttribute("elapsedTime",a);
}return true;
}if(this.elem.getAttribute("elapsedTime")){this.startTime=(+new Date)-this.elem.getAttribute("elapsedTime");
this.elem.removeAttribute("elapsedTime");
}}return this.oldstep(b);
};
Telerik.Web.UI.Animations.jMove=function(a,d,b,c,e){Telerik.Web.UI.Animations.jMove.initializeBase(this);
this._owner=a;
this._element=d;
this._duration=b;
this._horizontal=(typeof(c)=="undefined"||c==null)?0:c;
this._vertical=(typeof(e)=="undefined"||e==null)?0:e;
this._events=null;
this._animationEndedDelegate=null;
this._isPlaying=false;
this._isPaused=false;
this._isCyclic=false;
};
Telerik.Web.UI.Animations.jMove.prototype={initialize:function(){Telerik.Web.UI.Animations.jMove.callBaseMethod(this,"initialize");
this._animationEndedDelegate=Function.createDelegate(this,this._animationEnded);
},dispose:function(){this._getAnimationQuery().stop(true,false);
this._owner=null;
this._element=null;
this._animationEndedDelegate=null;
},get_vertical:function(){return this._vertical;
},set_vertical:function(a){this._vertical=a;
},get_horizontal:function(){return this._horizontal;
},set_horizontal:function(a){this._horizontal=a;
},get_isPlaying:function(){return this._isPlaying;
},get_isCyclic:function(){return this._isCyclic;
},set_isCyclic:function(a){this._isCyclic=a;
},get_isActive:function(){return true;
},play:function(d){var c=this._element;
var f=c.getAttribute("paused");
c.removeAttribute("paused");
if(!(f&&c.getAttribute("elapsedTime"))){var a=this._owner;
var g=a.get_frameDuration();
if(this._isPaused&&this._isCyclic&&(g>0&&!d)&&a._setAnimationTimeout){a._setAnimationTimeout(g);
}else{var b=this._animationStarted();
if(b!=false){var e=(isNaN(parseInt(this._vertical)))?this._horizontal:this._vertical;
this._playAnimation(e);
this._isPlaying=true;
this._isPaused=false;
}}}},stop:function(){this._getAnimationQuery().stop(false,true);
this._isPlaying=false;
},pause:function(){if(this._isPlaying){this._element.setAttribute("paused",true);
}this._isPlaying=false;
this._isPaused=true;
},add_started:function(a){this.get_events().addHandler("started",a);
},remove_started:function(a){this.get_events().removeHandler("started",a);
},add_ended:function(a){this.get_events().addHandler("ended",a);
},remove_ended:function(a){this.get_events().removeHandler("ended",a);
},_getAnimationQuery:function(){return $telerik.$(this._element);
},_playAnimation:function(d){var c=this._getAnimationQuery();
var b=this._getAnimatedStyleProperty();
var a={queue:true};
a[b]=d;
c.stop(true,!this._isCyclic).animate(a,this._duration,null,this._animationEndedDelegate);
},_getAnimatedStyleProperty:function(){return(isNaN(parseInt(this._vertical)))?"left":"top";
},_getPosition:function(){var b=this._element;
var a=this._getAnimatedStyleProperty();
return b.style[a];
},_animationStarted:function(){var a=new Sys.CancelEventArgs();
this._raiseEvent("started",a);
return !a.get_cancel();
},_animationEnded:function(){this._isPlaying=false;
this._raiseEvent("ended",Sys.EventArgs.Empty);
},_raiseEvent:function(b,c){var a=this.get_events().getHandler(b);
if(a){if(!c){c=Sys.EventArgs.Empty;
}a(this,c);
}}};
Telerik.Web.UI.Animations.jMove.registerClass("Telerik.Web.UI.Animations.jMove",Sys.Component);
